package com.javafactroy.kunlong.bip.icp.message.dxp.iface;

import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;

public interface IMsgHeader {
    int MAX_FRAME_LENGTH = 40 * 1024 * 1024;

    int TYPE_REQ = 0;
    int TYPE_RESP = 1;

    static String LINE_SPLIT = "\r\n";
    static String FIELD_SPLIT = "|";
    static String Algorithm_NONE = "NONE";
    static String Algorithm_BASE64 = "BASE64";
    static String Algorithm_MD5 = "MD5";
    final static BASE64Encoder encoder = new BASE64Encoder();
    final static BASE64Decoder decoder = new BASE64Decoder();

    byte[] encode();

    void decode(byte[] buf);

    void check();

    int getMsgId();
}
